<template>
  <section id="alert">
    <transition name="scale">
      <!--注册-->
      <div class="pop register" v-if="type===1&&bol">
        <button @click="close" class="pop_close"></button>
        <div class="pop_title">注册</div>
        <ul class="pop_content">
          <li class="com_input_item">
            <div class="input_box">
              <base-input
                id="tel"
                :type="types.tel"
                maxlength="11"
                placeholder="请输入11位手机号码"
                v-model="registerParams.tel"
                :rules="rules.tel"
                @input.native="isRegister(registerParams.tel)"
                @error="showError($event)"
              ></base-input>
              <img src="../assets/image/login.gif" alt class="loading_img" v-show="gifShow">
            </div>
            <div class="error" v-show="errorMsg.tel">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.tel}}
            </div>
          </li>
          <li class="com_input_item clearfix">
            <div class="input_box fl">
              <base-input
                type="text"
                maxlength="4"
                placeholder="输入动态验证码"
                v-model="registerParams.imgCode"
                :rules="rules.ImgYzm"
              ></base-input>
            </div>
            <base-imgyz :reset="ImgYzmReset"></base-imgyz>
          </li>
          <li class="com_input_item clearfix">
            <div class="input_box fl">
              <base-input
                id="verifyCode"
                maxlength="6"
                placeholder="请输入验证码"
                v-model="registerParams.verifyCode"
                :rules="rules.verifyCode"
                @error="showError($event)"
              ></base-input>
            </div>

            <base-yzm
              class="pop_btn w100 fr"
              :type="1"
              :mobile="registerParams.tel"
              :resetImg.sync="ImgYzmReset"
              :imgCode="registerParams.imgCode"
              :bol="registerParams.imgCode&&registerParams.tel&&!errorMsg.tel"
            ></base-yzm>
            <div class="error" v-show="errorMsg.verifyCode">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.verifyCode}}
            </div>
          </li>
          <li class="com_input_item">
            <div class="input_box">
              <base-input
                id="password"
                placeholder="设置密码8-20位字母加数字组合"
                :type="types.password"
                v-model="registerParams.password"
                :rules="rules.password"
                :compaire="registerParams.repassword"
                @error="showError($event)"
              ></base-input>
            </div>
            <div class="error" v-show="errorMsg.password">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.password}}
            </div>
          </li>
          <li class="com_input_item">
            <div class="input_box">
              <base-input
                id="repassword"
                placeholder="请再次输入密码"
                :type="types.password"
                v-model="registerParams.repassword"
                :rules="rules.repassword"
                :compaire="registerParams.password"
                @error="showError($event)"
              ></base-input>
            </div>
            <div class="error" v-show="errorMsg.repassword">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.repassword}}
            </div>
          </li>
          <li class="com_input_item">
            <div class="input_box">
              <base-input
                id="inviteCode"
                placeholder="输入邀请码（非必要选填）"
                v-model="registerParams.inviteCode"
                :rules="rules.inviteCode"
                maxlength="6"
                @error="showError($event)"
              ></base-input>
            </div>
            <div class="error" v-show="errorMsg.inviteCode">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.inviteCode}}
            </div>
          </li>

          <li class="com_button_item">
            <span class="pop_btn" :class="registerYZ?'curr':''" @click="register">注册</span>
          </li>
          <li class="backLogin">
            已有账号，
            <em @click="setType(2)">去登录</em>
          </li>
          <li class="partSmall">
            点击注册按钮即表示同意
            <span @click="setType(20,true)">《客户协议》</span>和
            <span @click="setType(21,true)">《隐私条款》</span>
          </li>
        </ul>
      </div>
      <!-- 登录 -->
      <div class="pop login" v-if="type===2&&bol">
        <button @click="close" class="pop_close"></button>
        <div class="pop_title">登录</div>
        <form @keydown.enter="login">
          <ul class="pop_content">
            <li class="com_input_item">
              <div class="input_box">
                <base-input
                  id="tel"
                  :type="types.tel"
                  placeholder="请输入11位手机号码"
                  v-model="loginParams.tel"
                  :rules="rules.tel"
                  @error="showError($event)"
                ></base-input>
              </div>
              <div class="error" v-if="errorMsg.tel">
                <img src="../assets/image/icon_tishi.png" alt="error">
                {{errorMsg.tel}}
              </div>
            </li>

            <li class="com_input_item">
              <div class="input_box">
                <base-input
                  id="loginPwd"
                  placeholder="请输入登录密码"
                  maxlength="20"
                  :type="types.password"
                  v-model="loginParams.pwd"
                  :rules="rules.loginPwd"
                  @error="showError($event)"
                ></base-input>
              </div>
              <div class="error" v-if="errorMsg.loginPwd">
                <img src="../assets/image/icon_tishi.png" alt="error">
                {{errorMsg.loginPwd}}
              </div>
            </li>

            <li class="com_button_item">
              <em
                class="pop_btn"
                @click.prevent="login"
                @keyup.enter="login"
                focusable="false;"
                :class="loginParams.tel&&loginParams.pwd&&!errorMsg.loginPwd&&!errorMsg.tel?'curr':''"
              >登录</em>
            </li>
            <li class="login_small_item">
              <span class="fl" @click="setType(14)">忘记密码</span>
              <span class="fr">
                还不是1805会员，
                <em @click="setType(1)">立即注册</em>
              </span>
            </li>
          </ul>
        </form>
      </div>
      <!--设置/修改资金密码-->
      <div class="pop setZJPwd" v-if="type===3&&bol">
        <button @click="close" class="pop_close"></button>
        <div class="pop_title">{{title+'资金密码'}}</div>
        <ul class="pop_content">
          <li class="com_font_item">手机号码 {{$js.phoneMd(user.mobile) }}</li>
          <li class="com_input_item clearfix">
            <div class="input_box fl">
              <base-input
                type="text"
                maxlength="4"
                placeholder="输入动态验证码"
                v-model="ZJPwdParams.imgCode"
                :rules="rules.ImgYzm"
              ></base-input>
            </div>
            <base-imgyz :reset="ImgYzmReset"></base-imgyz>
          </li>
          <li class="com_input_item clearfix">
            <div class="input_box fl">
              <base-input
                id="verifyCode"
                maxlength="6"
                placeholder="请输入验证码"
                v-model="ZJPwdParams.verifyCode"
                :rules="rules.verifyCode"
                @error="showError($event)"
              ></base-input>
            </div>

            <base-yzm
              class="pop_btn w100 fr"
              :type="2"
              :mobile="user.mobile"
              :resetImg.sync="ImgYzmReset"
              :imgCode="ZJPwdParams.imgCode"
              :bol="ZJPwdParams.imgCode"
            ></base-yzm>
            <div class="error" v-show="errorMsg.verifyCode">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.verifyCode}}
            </div>
          </li>
          <li class="com_input_item">
            <div class="input_box">
              <base-input
                id="password"
                placeholder="设置资金密码6位数字"
                maxlength="6"
                :type="types.password"
                v-model="ZJPwdParams.password"
                :rules="rules.zjpassword"
                :compaire="ZJPwdParams.repassword"
                @error="showError($event)"
              ></base-input>
            </div>
            <div class="error" v-show="errorMsg.password">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.password}}
            </div>
          </li>
          <li class="com_input_item">
            <div class="input_box">
              <base-input
                id="repassword"
                placeholder="请再次输入密码"
                maxlength="6"
                :type="types.password"
                v-model="ZJPwdParams.repassword"
                :rules="rules.zjrepassword"
                :compaire="ZJPwdParams.password"
                @error="showError($event)"
              ></base-input>
            </div>
            <div class="error" v-show="errorMsg.repassword">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.repassword}}
            </div>
          </li>
          <li class="com_button_item">
            <span class="pop_btn" :class="ZJPwdYZ?'curr':''" @click="ZJPwd">确定</span>
          </li>
        </ul>
      </div>
      <!--忘记密码-->
      <div class="pop setZJPwd" v-if="type===14&&bol">
        <button @click="close" class="pop_close"></button>
        <div class="pop_title">重置密码</div>
        <ul class="pop_content">
          <li class="com_font_item" v-if="user.mobile">手机号码 {{$js.phoneMd(user.mobile)}}</li>
          <li class="com_input_item" v-else>
            <div class="input_box">
              <base-input
                id="tel"
                :type="types.tel"
                maxlength="11"
                placeholder="请输入11位手机号码"
                v-model="backPwdParams.tel"
                :rules="rules.tel"
                @input.native="isRegister(backPwdParams.tel)"
                @error="showError($event)"
              ></base-input>
              <img src="../assets/image/login.gif" alt class="loading_img" v-show="gifShow">
            </div>
            <div class="error" v-show="errorMsg.tel">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.tel}}
            </div>
          </li>
          <li class="com_input_item clearfix">
            <div class="input_box fl">
              <base-input
                type="text"
                maxlength="4"
                placeholder="输入动态验证码"
                v-model="backPwdParams.imgCode"
                :rules="rules.ImgYzm"
              ></base-input>
            </div>
            <base-imgyz :reset="ImgYzmReset"></base-imgyz>
            <!-- <div class="error" v-show="errorMsg.verifyCode">
              <img src="../assets/image/icon_tishi.png" alt="error">{{errorMsg.verifyCode}}
            </div>-->
          </li>
          <li class="com_input_item clearfix">
            <div class="input_box fl">
              <base-input
                id="verifyCode"
                maxlength="6"
                placeholder="请输入验证码"
                v-model="backPwdParams.verifyCode"
                :rules="rules.verifyCode"
                @error="showError($event)"
              ></base-input>
            </div>

            <base-yzm
              class="pop_btn w100 fr"
              :type="1"
              :mobile="user.mobile?user.mobile:backPwdParams.tel"
              :resetImg.sync="ImgYzmReset"
              :imgCode="backPwdParams.imgCode"
              :bol="(user.mobile?user.mobile:!errorMsg.tel&&backPwdParams.tel)&&backPwdParams.imgCode"
            ></base-yzm>
            <div class="error" v-show="errorMsg.verifyCode">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.verifyCode}}
            </div>
          </li>
          <li class="com_input_item">
            <div class="input_box">
              <base-input
                id="password"
                placeholder="设置密码8-20位字母加数字组合"
                :type="types.password"
                v-model="backPwdParams.password"
                :rules="rules.password"
                :compaire="backPwdParams.repassword"
                @error="showError($event)"
              ></base-input>
            </div>
            <div class="error" v-show="errorMsg.password">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.password}}
            </div>
          </li>
          <li class="com_input_item">
            <div class="input_box">
              <base-input
                id="repassword"
                placeholder="请再次输入密码"
                :type="types.password"
                v-model="backPwdParams.repassword"
                :rules="rules.repassword"
                :compaire="backPwdParams.password"
                @error="showError($event)"
              ></base-input>
            </div>
            <div class="error" v-show="errorMsg.repassword">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.repassword}}
            </div>
          </li>
          <li class="com_button_item">
            <span class="pop_btn" :class="backPwdYZ?'curr':''" @click="backPwd">确定</span>
          </li>
        </ul>
      </div>
      <!--修改密码-->
      <div class="pop setZJPwd" v-if="type===22&&bol">
        <button @click="close" class="pop_close"></button>
        <div class="pop_title">修改登录密码</div>
        <ul class="pop_content">
          <li class="com_input_item">
            <div class="input_box">
              <base-input
                id="oldPwd"
                placeholder="请输入当前登录密码"
                :type="types.password"
                v-model="alterPwd.oldPwd"
                :rules="rules.oldPwd"
                @error="showError($event)"
              ></base-input>
            </div>
            <div class="error" v-show="errorMsg.oldPwd">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.oldPwd}}
            </div>
          </li>

          <li class="com_input_item">
            <div class="input_box">
              <base-input
                id="password"
                placeholder="设置密码8-20位字母加数字组合"
                :type="types.password"
                v-model="alterPwd.password"
                :rules="rules.password"
                :compaire="alterPwd.repassword"
                @error="showError($event)"
              ></base-input>
            </div>
            <div class="error" v-show="errorMsg.password">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.password}}
            </div>
          </li>
          <li class="com_input_item">
            <div class="input_box">
              <base-input
                id="repassword"
                placeholder="请再次输入密码"
                :type="types.password"
                v-model="alterPwd.repassword"
                :rules="rules.repassword"
                :compaire="alterPwd.password"
                @error="showError($event)"
              ></base-input>
            </div>
            <div class="error" v-show="errorMsg.repassword">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.repassword}}
            </div>
          </li>
          <li class="com_small_item">
            忘记密码
            <span @click="setType(14)">手机验证码找回</span>
          </li>
          <li class="com_button_item">
            <span class="pop_btn" :class="alterPwdYZ?'curr':''" @click="alterPwdSubmit">确定</span>
          </li>
        </ul>
      </div>
      <!--修改资金密码-->
      <div class="pop setZJPwd" v-if="type===23&&bol">
        <button @click="close" class="pop_close"></button>
        <div class="pop_title">修改资金密码</div>
        <ul class="pop_content">
          <li class="com_input_item">
            <div class="input_box">
              <base-input
                id="oldzjpassword"
                placeholder="请输入当前登录密码"
                maxlength="6"
                :type="types.password"
                v-model="alterZJPwd.oldPwd"
                :rules="rules.oldzjpassword"
                @error="showError($event)"
              ></base-input>
            </div>
            <div class="error" v-show="errorMsg.oldzjpassword">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.oldzjpassword}}
            </div>
          </li>
          <li class="com_input_item">
            <div class="input_box">
              <base-input
                id="password"
                placeholder="设置资金密码6位数字"
                maxlength="6"
                :type="types.password"
                v-model="alterZJPwd.password"
                :rules="rules.zjpassword"
                :compaire="alterZJPwd.repassword"
                @error="showError($event)"
              ></base-input>
            </div>
            <div class="error" v-show="errorMsg.password">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.password}}
            </div>
          </li>
          <li class="com_input_item">
            <div class="input_box">
              <base-input
                id="repassword"
                placeholder="请再次输入密码"
                :type="types.password"
                maxlength="6"
                v-model="alterZJPwd.repassword"
                :rules="rules.zjrepassword"
                :compaire="alterZJPwd.password"
                @error="showError($event)"
              ></base-input>
            </div>
            <div class="error" v-show="errorMsg.repassword">
              <img src="../assets/image/icon_tishi.png" alt="error">
              {{errorMsg.repassword}}
            </div>
          </li>
          <li class="com_small_item">
            忘记密码
            <span @click="setType(3)">手机验证码找回</span>
          </li>
          <li class="com_button_item">
            <span class="pop_btn" :class="alterZJPwdYZ?'curr':''" @click="alterZJPwdSubmit">确定</span>
          </li>
        </ul>
      </div>
      <!-- app下载 -->
      <div class="pop proDown" v-if="type===4&&bol">
        <h5>APP下载</h5>
        <div class></div>
        <p>行情随身掌握</p>
      </div>
      <!-- 联系客服 -->
      <div class="pop proDown" v-if="type===5&&bol">
        <h5>联系客服</h5>
        <div class></div>
        <p>客服微信</p>
      </div>
      <!-- 合约属性 -->
      <div class="pop contractAttr" v-if="type===6&&bol">
        <button @click="close" class="pop_close"></button>
        <div class="title">
          <p>合约属性</p>
          <span>{{attrData.goods_name}}（{{attrData.goods_code}}）</span>
        </div>
        <div class="pop_content">
          <table>
            <tr>
              <td>合约单位</td>
              <td v-if="attrData.goods_contract.unit">{{attrData.goods_contract.unit}}</td>
              <td v-else>--</td>
            </tr>
            <tr v-if="attrData.type_id==1 ? true:false">
              <td>基准货币</td>
              <td>{{attrData.goods_contract.base_coin}}</td>
            </tr>
            <tr v-else>
              <td>货币单位</td>
              <td>{{attrData.goods_contract.coin_unit}}</td>
            </tr>
            <tr v-if="attrData.type_id==1 ? true:false">
              <td>收益货币</td>
              <td v-if="attrData.goods_contract.profit_coin">{{attrData.goods_contract.profit_coin}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>报价小数位</td>
              <td
                v-if="attrData.goods_contract.price_decimal"
              >{{attrData.goods_contract.price_decimal}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>点差</td>
              <td v-if="attrData.goods_contract.difference">{{attrData.goods_contract.difference}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>单笔交易最小手数</td>
              <td v-if="attrData.goods_contract.min_hand">{{attrData.goods_contract.min_hand}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>单笔交易最大手数</td>
              <td v-if="attrData.goods_contract.max_hand">{{attrData.goods_contract.max_hand}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>最小挂单距离</td>
              <td
                v-if="attrData.goods_contract.min_distance"
              >{{attrData.goods_contract.min_distance}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>最大挂单距离</td>
              <td
                v-if="attrData.goods_contract.max_distance"
              >{{attrData.goods_contract.max_distance}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>止盈止损最小值</td>
              <td v-if="attrData.goods_contract.min_stop">{{attrData.goods_contract.min_stop}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>止盈止损最大值</td>
              <td v-if="attrData.goods_contract.max_stop">{{attrData.goods_contract.max_stop}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>挂单有效期</td>
              <td v-if="attrData.goods_contract.effective">{{attrData.goods_contract.effective}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>锁仓保证金</td>
              <td v-if="attrData.goods_contract.lock_ensure">{{attrData.goods_contract.lock_ensure}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>手数差值</td>
              <td
                v-if="attrData.goods_contract.hand_difference"
              >{{attrData.goods_contract.hand_difference}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>保证金/手</td>
              <td v-if="attrData.goods_contract.ensure">{{attrData.goods_contract.ensure}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>隔夜利息（买）</td>
              <td
                v-if="attrData.goods_contract.buy_interest"
              >{{attrData.goods_contract.buy_interest}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>隔夜利息（卖）</td>
              <td
                v-if="attrData.goods_contract.sell_interest"
              >{{attrData.goods_contract.sell_interest}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>三天隔夜利息</td>
              <td
                v-if="attrData.goods_contract.day_interest"
              >{{attrData.goods_contract.day_interest}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>结算时间</td>
              <td
                v-if="attrData.goods_contract.settlement_time"
              >{{attrData.goods_contract.settlement_time}}</td>
              <td v-else>--</td>
            </tr>
            <tr>
              <td>交易时间</td>
              <td
                v-if="attrData.goods_contract.transaction_time"
              >{{attrData.goods_contract.transaction_time}}</td>
              <td v-else>--</td>
            </tr>
          </table>
        </div>
        <p class="partSmall">
          <em>*</em> 本公司保留对以上数据可因市场情况而调整的权利
        </p>
      </div>
      <!--添加银行卡信息-->
      <div class="pop addCardNews" v-if="type===7&&bol">
        <button @click="close" class="pop_close"></button>
        <div class="pop_title">添加银行卡信息</div>
        <ul class="pop_content">
          <li class="com_input_item">
            <dl class="input_lr">
              <dt>姓 名：</dt>
              <dd>
                <base-input
                  id="chinaName"
                  placeholder="请输入持卡人姓名"
                  v-model="bankData.chinaName"
                  :rules="rules.chinaName"
                  @error="showError($event)"
                ></base-input>
              </dd>
            </dl>
            <div class="error" v-show="errorMsg.chinaName">
              <img src="../assets/image/icon_tishi.png">
              {{errorMsg.chinaName}}
            </div>
          </li>
          <li class="com_input_item">
            <dl class="input_lr">
              <dt>身份证：</dt>
              <dd>
                <base-input
                  id="idCard"
                  placeholder="请输入持卡人身份证号码"
                  v-model="bankData.idCard"
                  :rules="rules.idCard"
                  @error="showError($event)"
                  maxlength="18"
                ></base-input>
              </dd>
            </dl>
            <div class="error" v-show="errorMsg.idCard">
              <img src="../assets/image/icon_tishi.png">
              {{errorMsg.idCard}}
            </div>
          </li>
          <li class="com_input_item">
            <dl class="input_lr">
              <dt>手机号：</dt>
              <dd>
                <base-input
                  id="tel"
                  :type="types.tel"
                  placeholder="请输入持卡人银行预留的手机号"
                  v-model="bankData.tel"
                  :rules="rules.tel"
                  @error="showError($event)"
                  maxlength="11"
                ></base-input>
              </dd>
            </dl>
            <div class="error" v-show="errorMsg.tel">
              <img src="../assets/image/icon_tishi.png">
              {{errorMsg.tel}}
            </div>
          </li>
          <li class="com_input_item">
            <dl class="input_lr">
              <dt>银行卡：</dt>
              <dd>
                <base-input
                  id="bankCard"
                  placeholder="请输入银行卡号"
                  v-model="bankData.bankCard"
                  :rules="rules.bankCard"
                  @error="showError($event)"
                  @input="changeCard"
                  maxlength="23"
                ></base-input>
              </dd>
            </dl>
            <div class="error" v-show="errorMsg.bankCard">
              <img src="../assets/image/icon_tishi.png">
              {{errorMsg.bankCard}}
            </div>
          </li>
          <li class="com_input_item">
            <dl class="input_lr">
              <dt>开户行：</dt>
              <dd>
                <base-input
                  id="bankName"
                  placeholder="请输入开户行名称"
                  v-model="bankData.bankName"
                  :rules="rules.bankName"
                  @error="showError($event)"
                  maxlength="17"
                ></base-input>
              </dd>
            </dl>
            <div class="error" v-show="errorMsg.bankName">
              <img src="../assets/image/icon_tishi.png">
              {{errorMsg.bankName}}
            </div>
          </li>
          <li class="com_input_item">
            <dl class="input_lr">
              <dt>支 行：</dt>
              <dd>
                <base-input
                  id="branchBank"
                  placeholder="请输入开户行支行"
                  v-model="bankData.branchBank"
                  :rules="rules.branchBank"
                  @error="showError($event)"
                  maxlength="17"
                ></base-input>
              </dd>
            </dl>
            <div class="error" v-show="errorMsg.branchBank">
              <img src="../assets/image/icon_tishi.png">
              {{errorMsg.branchBank}}
            </div>
          </li>
          <li class="com_input_item">
            <dl class="input_lr">
              <dt>地 区：</dt>
              <dd>
                <base-input
                  id="bankArea"
                  placeholder="请输入银行卡所在地区，如北京"
                  v-model="bankData.bankArea"
                  :rules="rules.bankArea"
                  @error="showError($event)"
                ></base-input>
              </dd>
            </dl>
            <div class="error" v-show="errorMsg.bankArea">
              <img src="../assets/image/icon_tishi.png">
              {{errorMsg.bankArea}}
            </div>
          </li>

          <li class="com_button_item">
            <span class="pop_btn" :class="addBankYZ && 'curr'" @click="addBank">确定</span>
          </li>
        </ul>
        <p class="partSmall">
          <em>*</em> 请正确填写个人信息，否则无法正常提现
        </p>
      </div>
      <!-- 平仓成功 -->
      <div class="pop pcSuccess" v-if="type===8&&bol">
        <dl class="head">
          <dt>
            <img src="../assets/image/icon_queren_1@2x.png" alt="success">
            <p>平仓成功</p>
          </dt>
          <dd
            :class="Number(pcSuccessData.yingkui)>=0?'red':'green'"
          >{{ Number(pcSuccessData.yingkui)>=0?'+$'+pcSuccessData.yingkui:'-$'+Math.abs(Number(pcSuccessData.yingkui))}}</dd>
        </dl>
        <ul class="show">
          <li>
            <span>平仓时间</span>
            <span>{{ $js.timeToDate(pcSuccessData.create_time)}}</span>
          </li>
          <li>
            <span>交易产品</span>
            <span>{{pcSuccessData.goods_name}}</span>
          </li>
          <li>
            <span>市价平仓</span>
            <span>{{pcSuccessData.num}}手/{{pcSuccessData.end_price}}</span>
          </li>
          <li>
            <span>订单号</span>
            <span>{{pcSuccessData.order_id}}</span>
          </li>
        </ul>
        <em class="pop_btn curr" @click="close">确定</em>
      </div>
      <!-- 成功下单 -->
      <div class="pop pcSuccess XDSuccess" v-if="type===9&&bol">
        <dl class="head">
          <dt>
            <img src="../assets/image/icon_queren_1@2x.png" alt="success">
          </dt>
          <dd class="part">成功下单</dd>
        </dl>
        <!-- Successful -->
        <ul class="show">
          <li>
            <span>时间</span>
            <span v-if="Successful.create_time">{{$js.timeToDate(Successful.create_time)}}</span>
            <span v-else>- -</span>
          </li>
          <li>
            <span>交易产品</span>
            <span v-if="Successful.goods_name">{{Successful.goods_name}}</span>
            <span v-else>- -</span>
          </li>
          <li>
            <span v-if="Successful.shopType==1">市价买入</span>
            <span v-if="Successful.shopType==0">市价卖出</span>
            <span v-if="Successful.price">{{Successful.num}}手 /{{Successful.price}}</span>
            <span v-else>- -</span>
          </li>
          <li v-if="Successful.profit_price!=0">
            <span>止盈</span>
            <span v-if="Successful.profit_price!=0">{{Successful.profit_price}}</span>
            <span v-else>- -</span>
          </li>
          <li v-if="Successful.loss_price!=0">
            <span>止损</span>
            <span v-if="Successful.loss_price!=0">{{Successful.loss_price}}</span>
            <span v-else>- -</span>
          </li>
          <li>
            <span>订单号</span>
            <span v-if="Successful.order_id">{{Successful.order_id}}</span>
            <span v-else>- -</span>
          </li>
        </ul>
        <span class="pop_btn curr" @click="close">确定</span>
      </div>
      <!-- 确认选择 一个确认按钮-->
      <div class="pop enterChoose" :style="isAgent ? 'height:162px ':''" v-if="type===10&&bol">
        <button @click="close" class="pop_close"></button>
        <dl>
          <dt>
            <img src="../assets/image/icon_tishi_1@2x.png" alt="error">
          </dt>
          <dd>{{text}}</dd>
        </dl>
        <span v-if="pathBol==null" v-show="!isAgent" class="pop_btn curr">{{btnText}}</span>
        <span
          v-else
          @click="$router.push(pathBol)"
          v-show="!isAgent"
          class="pop_btn curr"
        >{{btnText}}</span>
      </div>
      <!-- 确认选择 一个确认按钮和一个取消按钮-->
      <div class="pop enterChoose2" v-if="type===17&&bol">
        <dl>
          <dt>
            <img src="../assets/image/icon_tishi_1@2x.png" alt="error">
          </dt>
          <dd>
            <p>{{text}}</p>
            <span>{{smallText}}</span>
          </dd>
        </dl>
        <div>
          <span class="pop_btn curr" @click="close">取消</span>
          <span class="pop_btn noback" @click="actionMethod">确定</span>
        </div>
      </div>
      <!-- 验证资金密码-->
      <div class="pop yzZJPWd" v-if="type===11&&bol">
        <input
          type="input"
          maxlength="6"
          v-model="zjPw"
          :style="foceBol?'background:#fff;':'background:rgba(246,246,246,1);'"
          @focus="foceBol=true"
          @blur="foceBol=false"
          @input="inputZJ"
        >

        <p>请输入资金密码</p>
        <div>
          <span class="pop_btn back" @click="close">取消</span>
          <span class="pop_btn curr" @click="toWithdraw">确定</span>
        </div>
      </div>
      <!--平仓-->
      <div class="pop pc" v-if="type===12&&bol">
        <button @click="close" class="pop_close"></button>
        <div class="pop_title">{{pcData.goods_name}}平仓</div>
        <div class="pc_cont">
          <div class="clearfix">
            <dl class="fl">
              <dt>买 入</dt>
              <dd
                :class="{red:pcData.zfType==1,green:pcData.zfType==2}"
              >{{pcData.inAndOut.in_price}}</dd>
            </dl>
            <dl class="fr">
              <dt>卖 出</dt>
              <dd
                :class="{red:pcData.zfType==1,green:pcData.zfType==2}"
              >{{pcData.inAndOut.out_price}}</dd>
            </dl>
          </div>
          <dl>
            <dt>浮动盈亏</dt>
            <dd
              :class="pcData.yingkui>=0?'red':'green'"
            >{{(pcData.yingkui>=0?'+':'')+pcData.yingkui}}</dd>
          </dl>
          <dl>
            <dt>开仓价格</dt>
            <dd>{{pcData.price}}</dd>
          </dl>
          <dl>
            <dt>平仓手数</dt>
            <dd class="countNumber">
              <em @click="handleIndex(false)">
                <img src="../assets/image/jian.png" alt>
              </em>

              <input type="number" placeholder="未设置" v-model="pcIndex" @keyup="keyUp()">
              <em @click="handleIndex(true)">
                <img src="../assets/image/jia.png" alt>
              </em>
            </dd>
          </dl>
        </div>
        <span class="pop_btn curr" @click="pcMethod">确定</span>
      </div>
      <!--设置止盈止损-->
      <div class="pop fitzyzs" v-if="type===13&&bol">
        <button @click="close" class="pop_close"></button>
        <div class="pop_title">{{pcData.goods_name}}</div>
        <div class="cont">
          <dl>
            <dt>止盈</dt>
            <dd class="countNumber">
              <em @click="handleYK(false,1)">
                <img src="../assets/image/jian.png" alt>
              </em>
              <input type="number" placeholder="未设置" v-model="stopIndex" @keyup="keyUp1('stop')">
              <em @click="handleYK(true,1)">
                <img src="../assets/image/jia.png" alt>
              </em>
            </dd>
          </dl>
          <p>
            价格范围：
            <em
              :class="((Number(stopIndex)<Number(ziyzis.zyMin)||Number(stopIndex)>Number(ziyzis.zyMax))&&Number(stopIndex))?'red':''"
            >{{ziyzis.zy}}</em>
          </p>
          <dl>
            <dt>止损</dt>
            <dd class="countNumber">
              <em @click="handleYK(false,2)">
                <img src="../assets/image/jian.png" alt>
              </em>
              <input type="number" placeholder="未设置" v-model="lossIndex" @keyup="keyUp1('loss')">
              <em @click="handleYK(true,2)">
                <img src="../assets/image/jia.png" alt>
              </em>
            </dd>
          </dl>
          <p>
            价格范围：
            <em
              :class="((Number(lossIndex)<Number(ziyzis.zsMin)||Number(lossIndex)>Number(ziyzis.zsMax))&&Number(lossIndex))?'red':''"
            >{{ziyzis.zs}}</em>
          </p>
        </div>
        <span class="pop_btn curr" @click="setzyzs">确定</span>
      </div>
      <!-- 挂单成功 -->
      <div class="pop pcSuccess XDSuccess" v-if="(type===15||type===16)&&bol">
        <dl class="head">
          <dt>
            <img src="../assets/image/icon_queren_1@2x.png" alt="success">
          </dt>
          <dd class="part">挂单成功</dd>
        </dl>
        <ul class="show">
          <li>
            <span>时间</span>
            <span>{{$js.timeToDate(Successful.create_time)}}</span>
          </li>
          <li>
            <span>交易产品</span>
            <span>{{Successful.goods_name}}</span>
          </li>
          <li>
            <span>{{ type==15?'新增停损':'新增限价'}}</span>
            <span>{{Successful.num}}手 /{{Successful.price}}</span>
          </li>
          <template v-if="Successful.profit_price!=0 || Successful.loss_price!=0">
            <li v-if="Successful.profit_price!=0">
              <span>止盈</span>
              <span>{{Successful.profit_price}}</span>
            </li>
            <li v-if="Successful.loss_price!=0">
              <span>止损</span>
              <span>{{Successful.loss_price}}</span>
            </li>
          </template>
          <li>
            <span>订单号</span>
            <span>{{Successful.order_id}}</span>
          </li>
        </ul>
        <span class="pop_btn curr" @click="close">确定</span>
      </div>
      <!-- 风险提示 -->
      <div class="pop riskWarning" v-if="type===18&&bol">
        <button @click="close" class="pop_close"></button>
        <div class="pop_title">风险揭示</div>
        <div class="riskWarning_cont" v-html="conf.risk_warning">
          <!-- <p>外汇交易风险须知：</p>充分披露过程的一部分是需要使客户同样简捷地决定是否投资决定的决定，两种决定需要享受平等的机会。 因此必须确保客户了解（以及浏览）损失的风险与了解获利的可能性一样简捷。下面是一个适当的风险披露的例子: "外汇保证金交易具有很大的风险, 未必适合所有的投资者。使用杠杆比例来进行外汇操作对交易者有利也有弊。在决定投资外汇市场，阁下应该仔细考虑阁下的投资目标，经验水平和承担风险的能力。遭受一部份或全部初始投资的损失的可能性是存在的。因此，阁下不应该以不能全部损失的资金来投资。并且, 阁下还应该留意所有与外汇投资相关的风险。若有任何疑问，应该向独立财务顾问咨询。"
          <p>1.客户交易前应充分了解交易平台的功能和交易规则，对于不熟悉交易规则和软件使用方法引起的损失，FXEX不负责.赔偿。</p>
          <p>2.客户需以自己的名义开户、取款、汇款，请不要交他人进行操作（包括任何人员都不能够替客户进行买卖操作），否则风险自负</p>
          <p>3.自身电脑和网络问题，建立电脑定期杀毒、设立防火墙等，网通电信多路上网备份</p>
          <p>4.快速波动市场的交易风险提示</p>银行报价及成交价都直接受市场流动性的影响，当重要数据公布、重大经济事件发生时，大量交易集中发生导致市场流动性过强；或者周末休市后开盘及平时凌晨交易清淡、流动性过低时，都极可能发生报价及成交价较平时不稳定的情况。例如，在美国公布非农就业数据前后大约两个小时的特殊时间内，国际市场行情会答复快速异常波动；交易商合作的清算期货市场和清算银行的成交价格、成交量、成交速度，均处于极其快速跳动的不稳定状态。或者周末休市后开盘及平时凌晨交易清淡、流动性过低时，都极可能发生报价及成交价较平时不稳定的情况
          <p>5.交易时保证金注意事项</p>客户在交易时需特别注意仓内可用保证金是否满足最底保证金要求，以免因保证金不足被系统强行平仓造成不必要的损失，当保证金率低于20%，系统强行平仓仓位，行情波动剧烈时，可能产生更多的亏损，请务必留足保证金抵抗该风险，如果客户因为没有及时缴纳保证金导致的强行平仓，1805不予赔偿。
          <p>6. 保证金交易的风险</p>外汇产品交易伴随很高风险。相对于外汇产品价格而言，初始保证金的金额可能比较小，这样交易就会被杠杆化。即使市场上出现比较小的变动，也会对客户已经或将要存入的资金产生相对大的影响：对客户也许有利，也许不利。客户可能需要为了保持头寸不被结算而需要承受客户存入本公司的初始保证金及任何追加资金上的损失。如果市场变动对客户不利或导致保证金水平下降，客户有可能无法及时追加保证金来维持头寸而在亏损的情况下被清算，客户将必须对由此造成的亏损自行负责。
          <p>7. 降低风险的指令或策略</p>下达某些旨在将损失/利益限制在特定金额的指令(例如“止损”指令，或者“止赢”指令)有可能并不见效或没有执行。如果订单是限价单，没办法保证订单以限价执行或会执行。一些实用头寸合并的策略，例如差价或同价对敲，或许与单纯做“长仓”或“短仓”存在着相同的风险。其他交易的额外风险
          <P>8. 交易设施</P>大部分电子交易的设施是通过以计算机为基础的系统来进行交易指令的传递、执行、匹配、登记和交易清算。与所有的设施和系统一样，他们容易受到临时故障的影响。客户收回某些损失的能力可能会受限于：系统提供者、市场、清算所及/或公司设定的有限度责任。这些有限度责任可能各有不同。
          <p>9. 电子交易</p>有别于公开喊价买卖的交易运作，电子交易会令客户有机会遇到由于计算机的硬件、软件及互联网传输的失误，而导致客户的指令处于未被执行或完全不会执行的问题，客户必须了解有关风险并不能将第三方风险转嫁至1805。
          <p>10. 场外交易</p>在某些司法辖区，且仅在限定的情况下，公司可被允许开展场外交易。这些交易或许会增加客户的投资风险，因为该公司可能是客户的交易对手。场外交易的监管一般较少，或由独立监管团体来负责监管。所以，在进行交易时，客户必须详细了解交易规则及可能出现的风险。
          <p>11.在其他司法辖区的交易</p>在其他司法辖区市场(包括正式连接到本地市场的市场)进行的交易可能会使客户面临其他风险。在那些市场的规定下，投资者受到的保障可能不同，或甚至会减低对投资者的保障。在开市交易前客户应该询问任何与客户交易有关的规定。客户的当地监管机构，将不能强迫执行客户交易所在的其他司法辖区的管理当局或市场的规定。客户应在交易前确定并了解本身所在地及其他司法管辖区可得到的补偿。
          <p>12.佣金以及其它费用</p>在客户开始交易之前，客户应该了解清楚所有佣金、收费及其他应付的费用。这些收费将会影响到客户的凈利润(如有)或增加客户的损失。
          <p>13. 暂停或限制交易与定价的关系</p>市场状况(例如流动性)及、或某些市场的运作条例(例如由于价格限制或停市造成的任何外汇产品暂停交易)，有可能增加损失的风险，因为完成交易或平清、对冲头寸已经变得很困难或不可能。再者，相关资产与外汇产品的正常价格关系可能不复存在，缺乏相关资产的参考价格，使“公平”价格难以判断。
          <p>14. 存放的现金与财物</p>客户必须熟悉各种有关“为进行当地或外地交易存放的金钱与财物”有哪些保障，特别是在公司资不抵债或破产的时候。客户可收回现金与财物的程度，是受制于特定法例或当地的规则。在有些司法辖区，当清债出现亏空时，特地标明为客户所有的财物将与现金一起被按比例加以分配。
          <p>15.不可抗力的风险</p>客户须知如果交易活动被不可抗力干扰时，客户的订单可能无法执行，或在相对通常情况不足的条件下被执行。不可抗力的情况包括但不限于：
          <ul>
            <li>1. 报价来源被暂时关闭、损坏或其他人和情况下关闭停止运作；</li>
            <li>2. 在相应交易市场上，外汇产品价格有异常变化或丧失流动性；</li>
            <li>3. 宏观经济数据报告的发表，或其他政治经济等方面的信息公布，对外汇产品价格有显着影响；</li>
            <li>4. 因硬件、软件的损坏，导致电子交易系统不能正常运作，1805不承担任何责任；</li>
            <li>5. 由于网络供货商的失误导致互联网连接失败；</li>
            <li>6. 国家行政部门的决定和命令；</li>
          </ul>-->
          <!-- <span class="pop_btn curr" @click="close">我已知晓</span> -->
        </div>
      </div>
      <!--免责申明-->
      <div class="pop freeDeclaration" v-if="type===19&&bol">
        <button @click="close" class="pop_close"></button>
        <div class="pop_title">免责申明</div>
        <div class="freeDeclaration_cont" v-html="conf.disclaimer">
          <!-- <p>以下内容为使用本网站的免责声明。请务必仔细阅读。如果您继续使用本网站即表示您已阅读并接受本免责声明。如果你不同意免责声明中的规定，请不要使用本网站。</p>
          <p>本网站提供信息资料的唯一目的是为了向公众提供信息，故没有任何明示或默示的担保责任。</p>
          <p>本网站是出于善意的动机而创办的，但并不能保证所含的信息都是全面准确的。我们不能对所有的信息都进行核实。您应该知道我们的信息可能不全，有疏漏或有些滞后。不管是本网站或独立的信息提供者都不会对任何因信息错误、不完整、迟延或基于对本网站信息的依赖而采取的任何措施负责。我们建议您在从事任何交易前应咨询您的金融顾问以确保信息的准确性。</p>
          <p>我们保留随时添加、删除或修改网站上任何信息的权利。您对本网站的访问意味着您同意不再进一步传播本网站的信息。</p>
          <p>在有管辖权的法律许可的范围内， 我们不对任何人因使用或信赖本网站所含的或通过本网站所获取的信息而产生的任何损失（包括间接、特别或任何理由的损失）承担责任。如果有管辖权的法律禁止本条规定，我们的责任将限于再次提供此类信息。</p>
          <p>即使因使用本网站所造成的损失是由于网站的错误、疏忽或故意所致，我们也不承担任何责任。我们也不能保证本网站免受病毒感染。象其他所有的网上交易一样，我们无法保证每笔交易都不会被别人截获、干扰或免受病毒的感染。我们也不对您不能收到任何信息或被未经许可的任何第三方接触到您的任何信息而承担任何责任。如果有管辖权的法律不允许全部免责，那么我们对您所承担的全部责任以您在网上浏览本网站所花费的费用（即邮电部门的上网费）为限。</p>
          <p>我们对链接到本网站上的其它网站上的信息不承担任何责任。您自己承担访问和使用那些网站的全部风险。我们不能控制也无法对本网站所链接的其它网站的资料承担任何责任。我们提供超链接仅为方便本网站的使用者。我们没有证实或赞成这些链接网站的内容或其信息来源。</p>
          <p>您一定不要把本网站的内容作为金融、法律、税收或其它任何方面的建议。做为提供金融咨询服务的专业人士，我们欢迎您在使用本网站的信息前向我们寻求独立的金融建议。</p>
          <span class="pop_btn curr" @click="close">我已知晓</span>-->
        </div>
      </div>
      <!--客户协议-->
      <div class="pop riskWarning" v-if="type===20&&bol">
        <button @click="close" class="pop_close"></button>
        <div class="pop_title">客户协议</div>
        <div class="riskWarning_cont" v-html="conf.registration_agreement">
          <!-- <p>主要事项</p>1805有限公司(“1805”)了解到每位客户之投资理念与背景均有不同，悉力为合资格客户提供迎合其需要之服务，并按客户递交之申请资料，评估产品是否适合客户。因此，若客户提供的资料在往后有所重要变动，您必须尽快经书面通知我们。 为协助打击恐怖主义的资金筹集行动和反洗钱活动，金融机构必须向所有申请者索取、核实和保存有关证明文件。因此，1805有责任索取您的姓名、地址、出生日期及其他个人资料，以核实阁下身份。1805亦可能要求阁下提供身份证明文件。
          <p>条款与声明</p>本人谨此声明本人在“个人资料”部分所提供的资讯为真实且正确。本人进一步声明本人将就任何的重大变化以书面通知1805。本人明白杠杆式外汇交易及其他杠杆式投资产品存在较大投资风险，对此进行投机交易可能并不适合本人。本人之亏损风险可能会超过最初投入之本金。
          <p>合适性警告</p>1805需要按监管机构指引向您作出声明：由于根据阁下填写的资料，阁下具有较少或缺乏投资经验，因此我们认为杠杆式投资产品可能并不适合阁下。由于阁下对相关投资产品之经验及知识并不足够，我们强烈建议阁下在开始真实交易之前，先试用我们的模拟账户。
          <p>免责声明</p>请阁下在递交申请表格前先细阅客户协议、产品风险披露声明及金融服务指引并确保完全明白、理解及同意全部内容。 阁下需了解外汇保证金、差价合约及杠杆式投资产品属高风险投资，亏损风险可以相当巨大或超过最初投入之本金，投资者需要具备相关投资经验、知识、风险管理认知及操作技巧才较适合参与，1805只作为交易执行之服务供应者，阁下需要按个人之判断进行交易。如有需要，请与本公司客户服务经理查询。
          <button
            class="pop_btn curr"
            @click="close"
          >我已知晓</button>-->
        </div>
      </div>
      <!--隐私条款-->
      <div class="pop privacyPolicy" v-if="type===21&&bol">
        <button @click="close" class="pop_close"></button>
        <div class="pop_title">隐私条款</div>
        <div class="privacyPolicy_cont" v-html="conf.privacy_policy">
          <!-- <p>尊重个人私隐和保密是1805一贯的政策。1805私隐政策是根据个人资料（私隐）条例保护客户权益，便利客户开设和维持外汇产品户口，提供融资和金融顾问服务。1805忠诚地为客户所提供的个人资料，作出保密的监控。除了得到法例批准，1805绝对不会把任何非公开性的数据给予任何个别人士。 当客户在1805开立或维持一个交易账户时，所提供的个人资料，只会作公司的内部商业用途，例如评估客户在财务上的需要，处理客户的交易以及其他要求，提供有关产品与服务，提供一般交易上的服务及按监管程序需要确认客户身份。1805需要客户提供以便运作的数据报括：</p>
          <ul>
            <li>
              (1) 有关1805的账户申请表格以及其他的表格上所要求提供的个人资料，包括但不
              限于例如姓名丶地址丶出生日
            </li>
            <li>(2) 有关客户在1805以及其附属公司的事务数据；</li>
            <li>(3) 有关客户调查报告公司的资料；</li>
            <li>(4) 有关核实客户身份的资料，例如政府文文件, 护照或驾驶执照。</li>
          </ul>
          <p>1805只会把客户所提供的数据，有限地让服务客户的雇员查阅，以便提供相关的客户服务和产品介绍。这些程序上的要求，都是为了保障客户的非公开性数据不会受到公开，保护客户的私隐。1805绝不会把客户的姓名和个人资料，销售或租借与任何人士。</p>
          <span class="pop_btn curr" @click="close">我已知晓</span>-->
        </div>
      </div>
      <!-- 余额不足 -->
    </transition>
    <transition name="shade">
      <div class="pop_shade" v-if="bol"></div>
    </transition>
  </section>
</template>
<script>
import { _login, _getUserInfo } from "../axios/index.js";
import { _hadRegister, _getConf, _register } from "../axios/index.js";
import { _forget } from "../axios/index.js";
import { _setBundPw } from "../axios/index.js";
import {
  _closeOut,
  _setzyzs,
  _changeLPW,
  _changeBundPw
} from "../axios/index.js";
import { request } from "http";
import { setTimeout } from "timers";
import { constants } from "crypto";
export default {
  data() {
    return {
      foceBol: false,
      pcIndex: 0,
      types: {
        tel: "tel",
        number: "number",
        password: "password"
      },
      loginParams: {
        //login参数
        tel: "",
        pwd: ""
      },
      ImgYzmReset: false, //重置图片
      registerParams: {
        //注册参数
        tel: "",
        verifyCode: "",
        password: "",
        repassword: "",
        inviteCode: "",
        imgCode: ""
      },
      alterPwd: {
        oldPwd: "",
        password: "",
        repassword: ""
      },
      alterZJPwd: {
        //修改资金密码
        oldPwd: "",
        password: "",
        repassword: ""
      },
      backPwdParams: {
        //找回密码参数
        verifyCode: "",
        password: "",
        repassword: "",
        imgCode: ""
      },
      ZJPwdParams: {
        //资金密码参数
        verifyCode: "",
        password: "",
        repassword: "",
        imgCode: ""
      },
      gifShow: false, //手机号验证gif图片
      rules: {
        tel: [
          { required: true, msg: "请输入手机号码" },
          {
            reg: /^(0|86|17951)?(13[0-9]|15[012356789]|17[012345678]|18[0-9]|14[56789]|19[0-9]|16[0-9])[0-9]{8}$/,
            msg: "手机号码格式不正确"
          }
        ],
        verifyCode: [
          { required: true, msg: "请输入验证码" },
          { reg: /^\d{6}$/, msg: "验证码格式不正确" }
        ],
        loginPwd: [
          { required: true, msg: "请输入密码" },
          {
            reg: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,20}$/,
            msg: "密码格式不正确"
          }
        ],
        oldPwd: [
          { required: true, msg: "请输入密码" },
          {
            reg: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,20}$/,
            msg: "密码格式不正确"
          }
        ],
        password: [
          { required: true, msg: "请输入密码" },
          {
            reg: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,20}$/,
            msg: "密码格式不正确"
          },
          { compaire: true, msg: "两次密码不一致" }
        ],
        repassword: [
          { required: true, msg: "请再次输入密码" },
          {
            reg: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,20}$/,
            msg: "密码格式不正确"
          },
          { compaire: true, msg: "两次密码不一致" }
        ],
        inviteCode: [
          {
            reg: /^\d{6}$/,
            msg: "邀请码格式不正确"
          }
        ],
         oldzjpassword: [
          { required: true, msg: "请输入资金密码" },
          {
            reg: /^\d{6}$/,
            msg: "资金密码格式不正确"
          },
        
        ],
        zjpassword: [
          { required: true, msg: "请输入资金密码" },
          {
            reg: /^\d{6}$/,
            msg: "资金密码格式不正确"
          },
          { compaire: true, msg: "两次密码不一致" }
        ],
        zjrepassword: [
          { required: true, msg: "请再次输入资金密码" },
          {
            reg: /^\d{6}$/,
            msg: "资金密码格式不正确"
          },
          { compaire: true, msg: "两次密码不一致" }
        ],
        chinaName: [
          { required: true, msg: "请输入姓名" },
          {
            reg: /^([\u4e00-\u9fa5\·]{2,10})$/,
            msg: "姓名格式不正确"
          }
        ],
        idCard: [
          { required: true, msg: "请输入身份证号码" },
          {
            reg: /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/,
            msg: "身份证号码格式不正确"
          }
        ],
        ImgYzm: [{ required: true, msg: "请输入图片验证码" }],
        bankCard: [{ required: true, msg: "请输入银行卡号码" }],
        bankName: [{ required: true, msg: "请输入开户行名称" }],
        branchBank: [{ required: true, msg: "请输入开户行支行" }],
        bankArea: [{ required: true, msg: "请输入开户行地区" }]
      },
      errorId: "",
      errorMsg: {
        tel: "",
        verifyCode: "",
        password: "",
        loginPwd: "",
        repassword: "",
        inviteCode: "",
        chinaName: "",
        idCard: "",
        bankCard: "",
        bankName: "",
        branchBank: "",
        bankArea: "",
        oldzjpassword:""
      },
      bankData: {
        chinaName: "", // 开户人姓名
        idCard: "", // 开户人身份证
        tel: "", // 银行留存手机号
        bankCard: "", // 银行卡号
        bankName: "", //开户行名称
        branchBank: "", // 开户行支行
        bankArea: "" // 开户行地区
      },
      bankList: [],
      pcSuccessData: "", //平仓成功数据
      hand_difference: 0.01, // 每次加减的手数
      minhand: 0.01, // 最小手数 默认0.01
      maxhand: 0, // 最大手数 默认50
      lossIndex: 0, //止损
      stopIndex: 0, //止盈
      zjPw: "", // 资金密码
      registerXY: false,
      inputproVal: "",
      isBind: false
    };
  },
  watch: {
    bol() {
      if (this.bol) {
        switch (this.type) {
          case 12://平仓
            this.pcIndex = this.pcNum;
            this.maxhand = this.pcNum;
            break;
          case 13://止盈止损
            this.lossIndex = Number(this.zsVal) == 0 ? "" : this.zsVal;
            this.stopIndex = Number(this.zyVal) == 0 ? "" : this.zyVal;
            break;
         
          case 18: this.$store.getters.countConf("risk_warning");break;//风险提示
          case 19:this.$store.getters.countConf("disclaimer");break;//免责声明
           case 20: this.$store.getters.countConf("registration_agreement");break;//客户协议
          case 21:this.$store.getters.countConf("privacy_policy");break;//隐私条款
           
        }
      } else {
        this.resetAll();
      }
    },
    type() {
      if (!this.registerXY) this.resetAll();
      if (this.bol) {
        switch (this.type) {
          case 18: this.$store.getters.countConf("risk_warning");break;//风险提示
          case 19:this.$store.getters.countConf("disclaimer");break;//免责声明
           case 20: this.$store.getters.countConf("registration_agreement");break;//客户协议
          case 21:this.$store.getters.countConf("privacy_policy");break;//隐私条款
           
        }
      }
    }
  },
  computed: {
    conf(){
       return this.$store.state.confObj;
    },
    ziyzis() {
      var self = this;
      if (self.pcData) {
        let zsBeforeVal = 0, //zs范围在前的值
          zsAfterVal = 0, //zs范围在后的值
          zyBeforeVal = 0, //zy范围在前的值
          zyAfterVal = 0, //zs范围在后的值
          reatTimePrice = Number(self.pcData.io_price), //实时价
          minUnitDigit = self.getFloat(self.pcData.io_price), //最小变化单位位数
          minUnit = Math.pow(10, -minUnitDigit), //最小变化单位
          minRange = Number(self.pcData.min_stop), //最小点数范围
          minRangeUnit = self.getFloat(self.pcData.min_stop, true), //最小点数范围位数
          maxRange = Number(self.pcData.max_stop), //最大点数范围
          maxRangeUnit = self.getFloat(self.pcData.max_stop, true); //最大点数范围位数
        if (Number(self.pcData.buy_type) == 1) {
          zsBeforeVal =
            reatTimePrice - maxRange * Math.pow(10, maxRangeUnit) * minUnit;
          zsAfterVal =
            reatTimePrice - minRange * Math.pow(10, minRangeUnit) * minUnit;
          zyBeforeVal =
            reatTimePrice + minRange * Math.pow(10, minRangeUnit) * minUnit;
          zyAfterVal =
            reatTimePrice + maxRange * Math.pow(10, maxRangeUnit) * minUnit;
        } else {
          zsBeforeVal =
            reatTimePrice + minRange * Math.pow(10, minRangeUnit) * minUnit;
          zsAfterVal =
            reatTimePrice + maxRange * Math.pow(10, maxRangeUnit) * minUnit;
          zyBeforeVal =
            reatTimePrice - maxRange * Math.pow(10, maxRangeUnit) * minUnit;
          zyAfterVal =
            reatTimePrice - minRange * Math.pow(10, minRangeUnit) * minUnit;
        }
        return {
          zy:
            Number(zyBeforeVal).toFixed(minUnitDigit) +
            " ～ " +
            Number(zyAfterVal).toFixed(minUnitDigit),
          zs:
            Number(zsBeforeVal).toFixed(minUnitDigit) +
            " ～ " +
            Number(zsAfterVal).toFixed(minUnitDigit),
          bol: true,
          zyMin: Number(zyBeforeVal).toFixed(minUnitDigit),
          zyMax: Number(zyAfterVal).toFixed(minUnitDigit),
          zsMin: Number(zsBeforeVal).toFixed(minUnitDigit),
          zsMax: Number(zsAfterVal).toFixed(minUnitDigit)
        };
      } else {
        return {
          zy: "0 ～ 0",
          zs: "0 ～ 0"
        };
      }
    },
    //是否能注册验证
    registerYZ() {
      return (
        this.registerParams.tel &&
        this.registerParams.verifyCode &&
        this.registerParams.password &&
        this.registerParams.repassword &&
        !this.errorMsg.tel &&
        !this.errorMsg.verifyCode &&
        !this.errorMsg.password &&
        !this.errorMsg.repassword &&
        !this.errorMsg.inviteCode
      );
    },
    //是否能找回密码
    backPwdYZ() {
      return (
        (this.user.mobile
          ? this.user.mobile
          : !this.errorMsg.tel && this.backPwdParams.tel) &&
        this.backPwdParams.verifyCode &&
        this.backPwdParams.password &&
        this.backPwdParams.repassword &&
        !this.errorMsg.verifyCode &&
        !this.errorMsg.password &&
        !this.errorMsg.repassword
      );
    },
    //是否能设置和修改资金密码
    ZJPwdYZ() {
      return (
        this.ZJPwdParams.verifyCode &&
        this.ZJPwdParams.password &&
        this.ZJPwdParams.repassword &&
        !this.errorMsg.verifyCode &&
        !this.errorMsg.password &&
        !this.errorMsg.repassword
      );
    },
    // 添加银行卡验证
    addBankYZ() {
      return (
        this.bankData.chinaName &&
        this.bankData.idCard &&
        this.bankData.tel &&
        this.bankData.bankCard &&
        this.bankData.bankName &&
        this.bankData.branchBank &&
        this.bankData.bankArea &&
        !this.errorMsg.chinaName &&
        !this.errorMsg.idCard &&
        !this.errorMsg.tel &&
        !this.errorMsg.bankCard &&
        !this.errorMsg.bankName &&
        !this.errorMsg.branchBank &&
        !this.errorMsg.bankArea
      );
    },
    alterPwdYZ() {
      return (
        this.alterPwd.oldPwd &&
        this.alterPwd.password &&
        this.alterPwd.repassword &&
        !this.errorMsg.oldPwd &&
        !this.errorMsg.password &&
        !this.errorMsg.repassword
      );
    },
    alterZJPwdYZ() {
      return (
        this.alterZJPwd.oldPwd &&
        this.alterZJPwd.password &&
        this.alterZJPwd.repassword &&
        !this.errorMsg.oldPwd &&
        !this.errorMsg.password &&
        !this.errorMsg.repassword
      );
    },
    user() {
      //是否登录
      return this.$store.state.user;
    }
  },
  props: {
    type: {
      type: Number,
      default: 1
    },
    bol: {
      default: false
    },
    title: {
      default: "1805"
    },
    text: {
      default: "请确定内容"
    },
    btnText: {
      default: "确定"
    },
    pathBol: {
      default: null
    },
    smallText: {
      default: "您确定需要取消该订单吗？"
    },
    pcData: "", //平仓数据
    pcNum: "", //平仓数量
    //止盈价
    zyVal: {
      default: 0
    },
    //止损价
    zsVal: {
      default: 0
    },
    //合约属性
    attrData: {
      default: null
    },
    //回调
    active: {
      default: "active"
    },
    //成功下单
    Successful: {
      default: null
    },
    //是否代理
    isAgent: {
      default: null
    }
  },
  methods: {
    async alterZJPwdSubmit($event) {
      let _self = this;
      if (!_self.alterZJPwdYZ) return;
      //md5(md5(密码)账号)
      let md5Pw = _self.$md5(
        _self.$md5(_self.alterZJPwd.password) + _self.user.mobile
      );
      let oldmd5Pw = _self.$md5(
        _self.$md5(_self.alterZJPwd.oldPwd) + _self.user.mobile
      );
      const data = {
        mon_password: md5Pw,
        old_mon_password: oldmd5Pw,
        user_type: _self.user.userType
      };
      const res = await _changeBundPw(data, { btn: $event.target });
      if (res.data.code === 200) {
        _self.$Message.success({
          content: res.data.msg,
          duration: 1
        });
        _self.close();
      } else {
        _self.$Message.error({
          content: res.data.msg,
          duration: 1
        });
      }
    },
    async alterPwdSubmit($event) {
      let _self = this;
      //md5(md5(密码)账号)
      if (!_self.alterPwdYZ) return;
      let md5Pw = _self.$md5(
        _self.$md5(_self.alterPwd.password) + _self.user.mobile
      );
      let oldmd5Pw = _self.$md5(
        _self.$md5(_self.alterPwd.oldPwd) + _self.user.mobile
      );
      let data = {
        password: md5Pw,
        old_password: oldmd5Pw
      };
      const res = await _changeLPW(data, { btn: $event.target });
      if (res.data.code === 200) {
      
        _self.$Message.success({
          content: res.data.msg+",请重新登录",
          duration: 1
        });
        _self.close();
          setTimeout(() => {
          _self.$store.commit("cleartloding", "/index");
        }, 1000);
       
      } else {
        _self.$Message.error({
          content: res.data.msg,
          duration: 1
        });
      }
    },
    inputZJ() {
      var p = "*";
      if (
        this.zjPw.length < this.inputproVal.length &&
        this.inputproVal != ""
      ) {
        this.inputproVal = this.inputproVal.substring(
          0,
          this.inputproVal.length - 1
        );
      } else {
        this.zjPw = this.zjPw.replace(/\D/g, "");
        this.inputproVal += this.zjPw;
      }

      this.zjPw = p.repeat(this.inputproVal.length);
    },
    resetAll() {
      this.inputproVal = "";
      this.errorMsg = {
         tel: "",
        verifyCode: "",
        password: "",
        loginPwd: "",
        repassword: "",
        inviteCode: "",
        chinaName: "",
        idCard: "",
        bankCard: "",
        bankName: "",
        branchBank: "",
        bankArea: "",
        oldzjpassword:""
      };
      this.backPwdParams = {
        //找回密码参数
        verifyCode: "",
        password: "",
        repassword: "",
        imgCode: ""
      };
      this.loginParams = {
        //login参数
        tel: "",
        pwd: ""
      };
      this.registerParams = {
        //注册参数
        tel: "",
        verifyCode: "",
        password: "",
        repassword: "",
        inviteCode: "",
        imgCode: ""
      };
      this.ZJPwdParams = {
        //资金密码参数
        verifyCode: "",
        password: "",
        repassword: "",
        imgCode: ""
      };
      this.alterPwd={
        oldPwd: "",
        password: "",
        repassword: ""
      };
      this.alterZJPwd={
        //修改资金密码
        oldPwd: "",
        password: "",
        repassword: ""
      };
    },
    bankCardFormat(value) {
      value = value.replace(/ /g, "");
      let arr = value.split("");
      let newArr = [];
      for (let i = 0; i < arr.length; i += 4) {
        newArr.push(arr.slice(i, i + 4).join(""));
      }
      let newValue = "";
      newValue = newArr.join(" ");
      return newValue;
    },
    changeCard() {
      this.bankData.bankCard = this.bankCardFormat(this.bankData.bankCard);
      let newCard = this.bankData.bankCard.replace(/ /g, "");
      let url =
        "https://ccdcapi.alipay.com/validateAndCacheCardInfo.json?_input_charset=utf-8&cardNo=" +
        newCard +
        "&cardBinCheck=true";
      if (newCard.length == 15 || newCard.length == 19) {
        this.axios({
          method: "get",
          url: url
        }).then(res => {
          if (res.data.validated) {
            this.bankData.bankName = this.$js.getBankName(res.data.bank);
          }
        });
      }
    },
    addBank() {
      let _self = this;
      if (!_self.addBankYZ) return;
      let data = {
        name: _self.bankData.chinaName,
        bank_number: _self.bankData.bankCard.replace(/ /g, ""), // 银行卡账号
        bank_name: _self.bankData.bankName, // 银行名称
        bank_branch: _self.bankData.branchBank, // 银行支行
        bank_mobile: _self.bankData.tel, // 11位手机号
        id_card: _self.bankData.idCard, // 身份证号码
        bank_area: _self.bankData.bankArea // 开户行银行所在地
      };
      if (!/^\d{15,20}$/.test(data.bank_number)) {
        this.$Message.error("银行卡格式有误");
        document.getElementById("bankCard").focus();
        return;
      }
      _self.$emit("addBankEvent", data);
      this.close();
    },
    close() {
      if (this.registerXY) {
        this.setType(1, true);
        setTimeout(() => {
          this.registerXY = false;
        }, 100);
      } else {
        this.$emit("update:bol", false);
      }

      if (this.type == 7) {
        this.bankData.chinaName = "";
        this.errorMsg.chinaName = "";
        this.bankData.bankCard = "";
        this.errorMsg.bankCard = "";
        this.bankData.bankName = "";
        this.errorMsg.bankName = "";
        this.bankData.branchBank = "";
        this.errorMsg.branchBank = "";
        this.bankData.tel = "";
        this.errorMsg.tel = "";
        this.bankData.idCard = "";
        this.errorMsg.idCard = "";
        this.bankData.bankArea = "";
        this.errorMsg.bankArea = "";
      } else if (this.type == 11) {
        this.zjPw = "";
      }
    },
    showError(data) {
      let _self = this;
      _self.errorMsg[data.id] = data.msg;
      if (!data.msg) {
        _self.errorMsg[data.id] = "";
      }
    },
    //修改弹窗类型
    setType(type, bol) {
      this.$emit("update:type", type);
      this.registerXY = bol; //注册协议
    },
    //登录
    async login($enent) {
      const _self = this;
      if (
        !(
          _self.loginParams.tel &&
          _self.loginParams.pwd &&
          !_self.errorMsg.loginPwd &&
          !_self.errorMsg.tel
        ) 
      ) {
        return;
      }

      //md5(md5(密码)账号)
      let md5Pw = _self.$md5(
        _self.$md5(_self.loginParams.pwd) + _self.loginParams.tel
      );
      const data = { mobile: _self.loginParams.tel, password: md5Pw };
      const res = await _login(data, { btn: $enent.target });
      if (res.data.code === 200) {
        localStorage.setItem("token", res.data.data.token);
        _self.$store.commit("setToken", res.data.data.token);
        var token = res.data.data.token;
        _self.$store.commit("setIsLogin", true);
        if (_self.$js.Socket) {
          _self.$js.Socket.send({ type: "login", token });
        }
        _self.$Message.success({
          content: "登录成功",
          duration: 1
        });
        _self.getUserInfo();
      } else {
        _self.$Message.error({
          content: res.data.msg,
          duration: 1
        });
      }
    },
    /**
     * 获取用户信息
     */
    async getUserInfo(bol) {
      let _self = this;
      const res = await _getUserInfo({user_type:1});
      if (res.data.code === 200) {
        _self.$store.commit("setUser", res.data.data);
        if (!bol) _self.close(); //关闭弹窗
      }
    },
    //验证手机号是否已注册
    async isRegister(tel) {
      let _self = this;

      if (_self.rules.tel[1].reg.test(tel)) {
        _self.gifShow = true;
        const res = await _hadRegister({ mobile: tel });
        if (res.status) {
          _self.gifShow = false;
        }
        if (res.data.code === 200 && res.data.msg === "手机号码已注册") {
          switch (_self.type) {
            case 1:
              _self.$set(_self.errorMsg, "tel", res.data.msg);
              break;
          }
        } else if (res.data.msg === "手机号码未注册") {
          // _self.errorMsg.tel = res.data.msg;
          switch (_self.type) {
            case 14:
              _self.$set(_self.errorMsg, "tel", "手机号码未注册");
              break;
          }
        }
      }
    },
    /**
     * 注册接口
     */
    async register($event) {
      let _self = this;
      //md5(md5(密码)账号)
      let md5Pw = _self.$md5(
        _self.$md5(_self.registerParams.password) + _self.registerParams.tel
      );
      if (!_self.registerYZ) return;
      let data = {
        mobile: _self.registerParams.tel,
        code: _self.registerParams.verifyCode,
        password: md5Pw,
        invite: _self.registerParams.inviteCode
      };
      if (_self.registerParams.inviteCode == "") {
        data.invite = "123456";
      }
      const res = await _register(data, { btn: $event.target });
      if (res.data.code === 200) {
        _self.$Message.success({
          content: res.data.msg,
          duration: 1
        });
        localStorage.setItem("token", res.data.data.token);
        _self.$store.commit("setToken", res.data.data.token);
        _self.getUserInfo();
      } else {
        _self.$Message.error({
          content: res.data.msg,
          duration: 1
        });
      }
    },
    //找回密码
    async backPwd($event) {
      let _self = this;
      //md5(md5(密码)账号)
      if (!_self.backPwdYZ) return;
      let md5Pw = _self.$md5(
        _self.$md5(_self.backPwdParams.password) +
          (_self.user.mobile ? _self.user.mobile : _self.backPwdParams.tel)
      );
      const data = {
        mobile: _self.user.mobile ? _self.user.mobile : _self.backPwdParams.tel,
        code: _self.backPwdParams.verifyCode,
        password: md5Pw
      };
      const res = await _forget(data, { btn: $event.btn });
      if (res.data.code === 200) {
        _self.$Message.success({
          content: res.data.msg+",请重新登录",
          duration: 1
        });
        _self.close(); //关闭弹窗
        setTimeout(() => {
       
          this.$store.commit("cleartloding", "/index");
        }, 1000);
      } else {
        _self.$Message.error({
          content: res.data.msg,
          duration: 1
        });
      }
    },
    //设置修改资金密码
    async ZJPwd($event) {
      let _self = this;
      //md5(md5(密码)账号)
      if (!_self.ZJPwdYZ) return;
      let md5Pw = _self.$md5(
        _self.$md5(_self.ZJPwdParams.password) + _self.user.mobile
      );
      const data = {
        mobile: _self.user.mobile,
        code: _self.ZJPwdParams.verifyCode,
        mon_password: md5Pw,
        user_type: _self.user.user_type
      };
      const res = await _setBundPw(data, { btn: $event.target });
      if (res.data.code === 200) {
        _self.$Message.success({
          content: res.data.msg,
          duration: 1
        });
        _self.$store.dispatch("getIsZJPWD");
        _self.close();
      } else {
        _self.$Message.error({
          content: res.data.msg,
          duration: 1
        });
      }
    },
    //限制加减的值
    handleIndex(bol) {
      var index = Number(this.pcIndex);
      if (bol) {
        var curVal = (index + 0.01).toFixed(2);
        this.pcIndex = curVal >= this.pcNum ? this.pcNum : curVal;
      } else {
        var curVal = (index - 0.01).toFixed(2);
        this.pcIndex = curVal <= 0 ? 0.01 : curVal;
      }
    },
    //平仓
    async pcMethod($event) {
      let self = this;
      if (
        0.01 > Number(self.pcIndex) ||
        Number(self.pcIndex) > Number(self.maxhand)
      ) {
        self.$Message.error({
          content: "平仓手数范围为0.01 ~ " + self.maxhand,
          duration: 1
        });
        return;
      }
      const res = await _closeOut(
        {
          order_id: self.pcData.order_id,
          uid: self.pcData.uid,
          goods_id: self.pcData.goods_id,
          num: self.pcIndex,
          buy_type: Number(self.pcData.buy_type)
        },
        $event.currentTarget
      );
      if (res.data.code == 200) {
        self.pcSuccessData = res.data.data[0];
        self.$Message.success({
          content: res.data.msg,
          duration: 1
        });
        self.$store.dispatch("getCcDataList");
        self.$store.dispatch("getddDataList");
        self.getUserInfo(true);
        self.$emit("update:type", 8);
      } else {
        self.$Message.error({
          content: res.data.msg,
          duration: 1
        });
      }
    },
    //设置止盈止损
    async setzyzs() {
      let self = this;
      console.log(self.stopIndex!=0);
      console.log(self.stopIndex!="");
      if ( (self.stopIndex < self.ziyzis.zyMin || self.stopIndex > self.ziyzis.zyMax)&& (self.stopIndex!=""&&self.stopIndex!=0)) {
        self.$Message.error({
          content: "止盈价格超出范围",
          duration: 1
        });
        return;
      }
      if((self.lossIndex < self.ziyzis.zsMin ||self.lossIndex > self.ziyzis.zsMax)&&(self.lossIndex!=""&&self.lossIndex!=0)){
              self.$Message.error({
              content: "止损价格超出范围",
              duration: 1
        });
        return;
      }
      const res = await _setzyzs({
        order_id: self.pcData.order_id,
        uid: self.pcData.uid,
        profit: self.stopIndex == "" ? 0 : self.stopIndex,
        loss: self.lossIndex == "" ? 0 : self.lossIndex,
        price: self.pcData.io_price
      });
      if (res.data.code == 200) {
        self.$Message.success({
          content: "设置成功",
          duration: 1
        });
        self.$store.dispatch("getCcDataList");
        self.close();
      } else {
        self.$Message.error({
          content: res.data.msg,
          duration: 1
        });
      }
    },
    keyUp(model) {
      let _self = event.currentTarget;
      _self.value = _self.value.replace(/[^0-9/.]/g, "");
      if (
        Number(_self.value) > 0 &&
        String(_self.value).indexOf(".") > -1 &&
        String(_self.value).split(".")[1].length > 2
      ) {
        _self.value = Number(
          String(_self.value).split(".")[0] +
            "." +
            String(_self.value)
              .split(".")[1]
              .slice(0, 2)
        ).toFixed(2);

        this.pcIndex = _self.value;
        return;
      }
    },

    keyUp1(model) {
      let minUnitDigit = this.getFloat(this.pcData.io_price); //最小变化单位位数
      let _self = event.currentTarget;
      _self.value = _self.value.replace(/[^0-9/.]/g, "");
      if (
        Number(_self.value) > 0 &&
        String(_self.value).indexOf(".") > -1 &&
        String(_self.value).split(".")[1].length > minUnitDigit
      ) {
        _self.value = Number(
          String(_self.value).split(".")[0] +
            "." +
            String(_self.value)
              .split(".")[1]
              .slice(0, 2)
        ).toFixed(minUnitDigit);
        if (model == "loss") {
          this.lossIndex = _self.value;
        } else {
          this.stopIndex = _self.value;
        }
        return;
      }
    },
    getFloat(val, bol) {
      let _self = this;
      let _default = bol ? 0 : 1;

      let maxVal =
        String(val).split(".").length == 2
          ? val.split(".")[1].length
          : _default; // 最小变化单位
      return maxVal;
    },
    //
    handleYK(bol, type) {
      var self = this;
      let minUnitDigit = this.getFloat(this.pcData.io_price), //最小变化单位位数
        minUnit = Math.pow(10, -minUnitDigit); //最小变化单位
      let zyzs = this.ziyzis;
      let yzMin = Number(zyzs.zyMin),
        yzMax = Number(zyzs.zyMax),
        ysMin = Number(zyzs.zsMin),
        ysMax = Number(zyzs.zsMax);
      if (!zyzs.bol) return;
      if (type == 1) {
        var index = Number(this.stopIndex);

        if (index < self.ziyzis.zyMin || index > self.ziyzis.zyMax) {
          if (self.pcData.buy_type == 1) {
            //买入止盈
            self.stopIndex = yzMin;
          } else {
            //卖出止盈
            self.stopIndex = yzMax;
          }
        } else {
          if (bol) {
            var curVal = (index + minUnit).toFixed(minUnitDigit);
            this.stopIndex = curVal >= yzMax ? yzMax : curVal;
          } else {
            var curVal = (index - minUnit).toFixed(minUnitDigit);
            this.stopIndex = curVal <= yzMin ? yzMin : curVal;
          }
        }
      } else {
        var index = Number(this.lossIndex);
        if (index < self.ziyzis.zsMin || index > self.ziyzis.zsMax) {
          if (self.pcData.buy_type == 1) {
            //买入止损
            self.lossIndex = ysMax;
          } else {
            //卖出止损
            self.lossIndex = ysMin;
          }
        } else {
          if (bol) {
            var curVal = (index + minUnit).toFixed(minUnitDigit);
            this.lossIndex = curVal >= ysMax ? ysMax : curVal;
          } else {
            var curVal = (index - minUnit).toFixed(minUnitDigit);
            this.lossIndex = curVal <= ysMin ? ysMin : curVal;
          }
        }
      }
    },
    toWithdraw() {
      if (this.inputproVal && this.inputproVal.length === 6) {
        this.$emit("zjpw", this.inputproVal);
        this.close();
      } else {
        this.$Message.error("请输入6位数字资金密码");
      }
    },
    actionMethod() {
      this.$emit(this.active);
    }
  },
  mounted() {
    // var _self = this;
    // document.onkeydown = function(event) {
    //   var e = event || window.event || arguments.callee.caller.arguments[0];
    //   if (e && e.keyCode == 13) {
    //     _self.login();
    //   }
    // };
  }
};
</script>
